﻿using System.Threading.Tasks;

namespace Beeflys
{
    public abstract partial class AMessenger : AMountable
    {
        internal void Constructor(AActor actor)
        {
            base.Constructor(actor, new MessengerLogger(this));
        }

        internal override void Destructor()
        {
            base.Destructor();
        }
        
        public Task<TComponent> GetComponentAsync<TComponent>() where TComponent : AComponent, new()
        {
            return this.Actor.GetComponentAsync<TComponent>();
        }

        public Task<TMessenger> GetMessengerAsync<TMessenger>() where TMessenger : AMessenger, new()
        {
            return this.Actor.GetMessengerAsync<TMessenger>();
        }
    }
}